package com.vmj.test.example;

/**
 * Created by yangshoujun on 2017/9/9 下午10:14.
 */
public class Strings {

    public static void main(String[] args) {
        concat();
    }

    public static void helloWord() {
        String str = "hello word!";
        System.out.println(str);
    }

    public static void helloWord2(String[] args) {
        for(String arg : args) {
            System.out.print(arg);
            System.out.print(" ");
        }
        System.out.println();
    }

    public static void strArr() {
        String[] args = new String[]{"hello", "word", "!"};
        System.out.println(args[0]);
        System.out.println(args[1]);
        System.out.println(args[2]);
    }

    public static void strArr2() {
        String[] args = new String[]{"how", "are", "you?"};
        for(String str : args) {
            System.out.print(str);
            System.out.print('\t');
        }
        System.out.println();
    }

    public static void concat() {
        String s1 = "1";
        String s2 = "2";
        String s3 = "3";
        String s4 = s1 + s2;
        boolean b = s1 == s2;
        String s5 = "hello " + "word" + "! " + s1;
    }
}
